package org.nf.service;

import org.nf.dao.UserAllDao;
import org.nf.dao.impl.UserAllDaoImpl;
import org.nf.entity.User;

import java.util.List;

/**
 * @Author lzp
 * @Date 2024-04-25
 */
public class UserService {
    /**
     * 查看所有用户
     * @return
     */
    public List<User> findAllUser (){
        UserAllDao userAllDao = new UserAllDaoImpl();
        return userAllDao.userAll();
    }

    public static void main(String[] args) {
        UserService userService = new UserService();
        List<User> allUser = userService.findAllUser();
        for (User user : allUser) {
            System.out.println(user.getId() +"  "+ user.getUsername());
        }
    }

}
